package ch03.test;

import java.lang.reflect.Proxy;

public class GuestProxyFactory {
    public static <T> T create(Object target){
        GuestInvocationHandler handler=new GuestInvocationHandler();
        handler.setTarget(target);
        return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(),target.getClass().getInterfaces(),handler);
    }
}
